package com.cc.visitor.enums;

/**
 * @author chanchaw
 * @create 2024-09-28 14:30
 */
public enum LogErrorModule {
    BACKEND(1,"backend","java后台"),MINI(1,"mini","微信小程序"),
    WEB(2,"web","前端WEB页面"),
    ;
    private int id;
    private String sid;
    private String remark;
    public int getId() {return id;}
    public String getSid() {return sid;}
    public String getRemark() {return remark;}

    LogErrorModule(int id,String sid, String remark) {
        this.id = id;
        this.sid = sid;
        this.remark = remark;
    }

    // 根据索引返回枚举值
    public static LogErrorModule ofid(int id){
        for(LogErrorModule item:LogErrorModule.values()){
            if(item.getId() == id) return item;
        }
        return null;
    }

    public static LogErrorModule ofsid(String sid){
        for(LogErrorModule item:LogErrorModule.values()){
            if(item.getSid().equals(sid)) return item;
        }
        return null;
    }
}
